<?php require_once('Select_town/Connections/connection.php'); ?>
<?php
mysql_select_db($database_connection, $connection);
$query_rs_town = "SELECT * FROM tbl_town ORDER BY town_name ASC";
$rs_town = mysql_query($query_rs_town, $connection) or die(mysql_error());
?>

<!-- show doctor in beauty clinic -->
<?   
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("database");
mysql_query("SET NAMES UTF8");
$strSQL = "SELECT * FROM doctor " ;
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>



<?
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("database");
$strSQL2 = "SELECT * FROM doctor ";
$objQuery2 = mysql_query($strSQL2) or die ("Error Query [".$strSQL2."]");
$Num_Rows = mysql_num_rows($objQuery);

$Per_Page = 4;   // Per Page

$Page = $_GET["Page"];
if(!$_GET["Page"])
{
	$Page=1;
}

$Prev_Page = $Page-1;
$Next_Page = $Page+1;

$Page_Start = (($Per_Page*$Page)-$Per_Page);
if($Num_Rows<=$Per_Page)
{
	$Num_Pages =1;
}
else if(($Num_Rows % $Per_Page)==0)
{
	$Num_Pages =($Num_Rows/$Per_Page) ;
}
else
{
	$Num_Pages =($Num_Rows/$Per_Page)+1;
	$Num_Pages = (int)$Num_Pages;
}

$strSQL .=" order  by clinic_id DESC LIMIT $Page_Start , $Per_Page";
$objQuery  = mysql_query($strSQL);
?>



<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title> BeautyClinic  </title>

<!-- Linking styles -->
<link rel="stylesheet" href="css/screen.css" type="text/css" media="screen" title="default" />

<!--  jQuery Sidebar Sliding Tab Menu Tutorial  -->
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js'></script>
<script src="js/jquery/tabbedContent.js" type="text/javascript"></script>
    

<!-- Start ------ Select Zone Town Amphur -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
 	$("#town_id").change(function(){
	
		var url = "Select_town/amphur.php?town_id="+$(this).val() ;

		$.getJSON(
				url ,
				function(resp){
					var opt = "<option value='0'>-- อำเภอ --</option>";
					
					for(var i=0;i<resp.length;i++){
						opt += "<option value='"+ resp[i].amphur_id+"'>"+resp[i].amphur_name+"</option>";
					}
					$("#amphur_id").html( opt );
				} 
		);
	});
})
</script>
<script type="text/javascript">
$(function(){
 	$("#amphur_id").change(function(){
	
		var url = "Select_town/tambon.php?amphur_id="+$(this).val() ;

		$.getJSON(
				url ,
				function(resp){
					var opt = "<option value='0'>-- ตำบล --</option>";
					
					for(var i=0;i<resp.length;i++){
						opt += "<option value='"+ resp[i].tambon_id+"'>"+resp[i].tambon_name+"</option>";
					}	
					$("#tambon_id").html( opt );
				} 
		);
	});
})
</script>
<!-- End ------ Select Zone Town Amphur -->



 </head>

<body>
<!-- Menu -->
    <header>
    <div class="marg">
        <div class="header">
 
	<!--  START Header -->
	<div id="Header">
			<!-- Start: page-top --> 	
			<div id="page-top"> </div>
			<!-- End: page-top -->
		<div class="clear">&nbsp;</div>
	</div>
	<!-- End: Header -->
	

<!--  START nav-outer-repeat -->
<div class="nav-outer-repeat"> 

<!-- START ........................................................................................................................ START MAIN-->
<div id ="main">

	<!--  start nav-outer -->
	<div class="nav-outer"> 

		<!-- start nav-right -->
		<div id="nav-right">	
				<? if(isset($_COOKIE["USER"]) == false){ ?>
					<div class="nav-divider-right">&nbsp;</div>

 					 <a href="./login.php"><img src="images/shared/login.png" alt="" /></a> 

					<div class="nav-divider-right">&nbsp;</div>

					 <a href="./signup.php"> <img src="images/shared/signup.png" alt="" /></a> 
		 
 					<div class="nav-divider-right">&nbsp;</div>
                <? } 
				
				else{ ?>
					<div id="member-form">
						<div class="nav-divider-right">&nbsp;</div>

  						<a href="./logout.php"> <img src="images/shared/logout.png" alt="" /> </a> 
	
  						<div class="nav-divider-right">&nbsp;</div>
	
 						<div class="member-bar-form"><a>  ยินดีต้อนรับ คุณ  <u>  <?=$_COOKIE["USER"]?>    </u>  </a>  </div>
				  
						 <div class="nav-divider-right">&nbsp;</div>
					</div>
            <? } ?>
 
				<div class="clear">&nbsp;</div>		 
		</div> <!--  END nav-right -->


		<!--  start nav left-->
		<div class="nav">
		<div class="table">
				<div class="nav-divider">&nbsp;</div>
				
				<ul class="select"><li> <a href="./index.php"> <b> หน้าหลัก </b> </a> </li></ul>
				<div class="nav-divider">&nbsp;</div>
								
				<ul class="select"><li> <a href="./clinic.php"> <b> ศูนย์ศัลยกรรม </b> </a> </li></ul>
				<div class="nav-divider">&nbsp;</div>
			
				<ul class="current"><li><a href="./doctor.php"> <b> ศัลยแพทย์ </b> </a> <!--[if lte IE 6]></td></tr></table></a><![endif]--> </li> </ul>
				<div class="nav-divider">&nbsp;</div>
			
				<ul class="select"><li><a href="#nogo"> <b> รีวิวการศัลยกรรม </b> </a> </li> </ul>
				<div class="nav-divider">&nbsp;</div>		
				
				<ul class="select"><li><a href="#nogo"> <b> ศัลย์วาไรตี้ </b> </a> </li> </ul>
				<div class="nav-divider">&nbsp;</div>
	 
				<div class="clear"></div>
		</div> <!--  END table -->

				<div class="clear"></div>	
		</div> <!--  END nav -->

</div> <!--  ............. end main .............  -->

			<div class="clear"></div>
	</div> <!--  END nav-outer -->

</div>
<!--  END nav-outer-repeat -->





<!--  ..... start content-bg --- M A P .....  -->
<div id="content-bg">
<!-- 
<div id="map"><iframe width="100%" height="250" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=+%E0%B8%AD.%E0%B9%80%E0%B8%A1%E0%B8%B7%E0%B8%AD%E0%B8%87%E0%B8%9E%E0%B8%B4%E0%B8%A9%E0%B8%93%E0%B8%B8%E0%B9%82%E0%B8%A5%E0%B8%81+%E0%B8%88.%E0%B8%9E%E0%B8%B4%E0%B8%A9%E0%B8%93%E0%B8%B8%E0%B9%82%E0%B8%A5%E0%B8%81+%E0%B8%9B%E0%B8%A3%E0%B8%B0%E0%B9%80%E0%B8%97%E0%B8%A8%E0%B9%84%E0%B8%97%E0%B8%A2&amp;aq=t&amp;sll=16.816134,100.262389&amp;sspn=0.010578,0.018475&amp;ie=UTF8&amp;hq=&amp;hnear=Mueang+Phitsanulok,+Phitsanulok,+Thailand&amp;ll=16.819922,100.262500&amp;spn=0.010578,0.018475&amp;t=m&amp;z=15&amp;output=embed" ></iframe></div>

<div class="clear">&nbsp;</div>
 -->
</div>
<!--  ..... end content-bg --- M A P ..... -->




<!--  ............. START bar_map .............  
		<div id="bar_map">
				<div id="bar_map1"> </div>
		</div>
<!--  ............. END bar_map .............  -->




<!-- START ........................................................................................................................ START MAIN-->
<div id ="main">
							
  
<!-- start container -- จัดกลาง -->
<div id="container">
 
 
 
<table border=0>
<tr><td width=960px> <h4> ศัลยแพทย์   </h4> </td>  <td width=90px align=right>  <img src="./images/shared/facebook.png" /> </td>
</tr>
</table>
<hr width="970px"> <br>




<!--  START --- C o n t e n t --> 
<div id="content">

 

 
<div class="left">    <!--  START --- C o n t e n t --- left -->
 <div class="clinic_title">
 
<!--  START --- S e a r c h --->
<div id="search_web_doctor">	 

<form id="form1" name="form1" method="post" action="">

		<table border="0"   id="search_web_doctor-form" >
			<tr>
				<td valign="middle" colspan="6" > <font size="5">  เมนูค้นหาศัลยแพทย์        </font></td>
			</tr>
			<tr><td colspan=6 ><hr></td></tr>

								<tr><td height="20px">   </td></tr>


 			<tr valign="middle" >		<td width="18px"></td>					 
				<td colspan="6"> <input type="text" name="search"   placeholder=" ค้นหาศัลยแพทย์ ที่นี่ "    class="search-dr-form_search" /> </td>
			</tr>
 								<tr><td height="20px">   </td></tr>
 			<tr>
				<td width="14px"></td>
				<th valign="middle" align="left"   for="town_id">จังหวัด : </th>  	
				<td width="50px"></td>
				<th valign="middle" align="left"    for="amphur_id">อำเภอ : </th>
				<td width="50px"></td>
				<th valign="middle" align="left"    for="tambon_id">ตำบล  : </th>
			</tr>

 			<tr valign="middle" > 
				<td width="14px"></td>

				<td>	
							<select name="town_id" id="town_id" class="search-dr-form_selectbox">
									<option value="0">-- เลือกจังหวัด --</option>
								<?php while( $row_rs_town= mysql_fetch_assoc($rs_town) ) : ?>
									<option value="<?php echo $row_rs_town['town_id']?>"><?php echo $row_rs_town['town_name']?></option>
								<?php endwhile ;?>
							</select>
				</td>

				<td width="50px"></td>
   				<td>	
							<select name="amphur_id" id="amphur_id" class="search-dr-form_selectbox">
									<option value="0">-- เลือกอำเภอ --</option>
								<?php while( $row_rs_amphur = mysql_fetch_assoc($rs_amphur) ) : ?>
									<option value="<?php echo $row_rs_amphur['amphur_id']?>"><?php echo $row_rs_amphur['amphur_name']?></option>
								<?php endwhile ;?>
							</select>
				</td>

				<td width="50px"></td>
 				<td>	
							<select name="tambon_id" id="tambon_id" class="search-dr-form_selectbox">
									<option value="0">-- เลือกตำบล --</option>
							</select>
				</td>
			</tr>
 								<tr><td> &nbsp; </td></tr>

			<tr>
				<td width="14px"></td><th valign="middle" align="left" colspan="6">ความประทับใจ (เฉลี่ย) : </th>
			</tr>
 			<tr>		<td></td>
				<td  valign="top"  colspan="4" >	
					<select  class="search-dr-form_selectbox" >
						<option value="">ทั้งหมด</option>
						<option value="">ความสะอาด สะดวกสบาย</option>
						<option value="">สถานที่ตั้ง</option>
						<option value="">การให้บริการ</option>
					</select>
				</td>
 			 	<td align="right" >  <input type="button" value=" ค้นหาข้อมูล " class="btn_search" />   </td>  <td width="14px"></td>
			<tr>
  		</table>
 </form>
 </div>
	 </div>		<!--  END --- S e a r c h --> 


 
 
 
<div class="left">    <!--  START --- C o n t e n t --- left -->
 <div class="clinic_title">
	<div class = "toptitle_bar">  </div> 
	<div class = "toptitle_doctor_inbc">  </div>
</div>
 
 	<div class="side_doctor_etc"> 	<!--  START --- Doctor SHOW etc -->	

<? 
while($objResult2 = mysql_fetch_array($objQuery2))
{ 
?>	

<div class="sidebar_doctor_etc">    <!--  start sidebar_doctor_show etc -->
 			<ul>  <a href="doctorshow.php?dr_id=<?=$objResult2["dr_id"];?>"> 	
				<img src="myfile/<?=$objResult2["dr_pic"];?>" class="img_doctor_etc" />
<table border="0" > <tr> 
		<td  width="370px">
				<li> <h3> <img src=" "  />ศัลยแพทย์ <?=$objResult2["dr_name"];?>   </h3> </li>
  				<li> <img src="./images/shared/review/clinic.png">  ศูนย์ศัลยกรรม <?=$objResult2["clinic_name"];?>    </li>
  				<li> พื้นที่ :  ตำบล <?=$objResult2["clinic_tambon"];?>  อำเภอ  <?=$objResult2["clinic_amphur"];?>                      </li>
			</ul>
		</td>
 
		<td align="right" width="200px">
			<ul>
				<li> &nbsp;  </li>	<li> &nbsp; </li>	<li> &nbsp; </li> 
 				<li> vote 0  <img src="./images/shared/review/comment.png"> 0 reviews </li>
 		</a></ul>
		</td>
</tr> </table>
</div>	 <!--  end sidebar_doctor_show etc -->
<? } ?>		

 <?
if($Prev_Page)
{
	echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'>ย้อนกลับ </a> ";
}

 for($i=1; $i<=$Num_Pages; $i++){
	if($i != $Page)
	{
		echo "  <a href='$_SERVER[SCRIPT_NAME]?Page=$i'> <u> $i  </u> </a>    ";
 	}
	else
	{
		echo "   <a> <b> $i </b> </a>";
 	}
}
if($Page!=$Num_Pages)
{
	echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'> ถัดไป</a> ";
}
mysql_close($objConnect);
?>  
		
	</div>   <!--  End --- Doctor SHOW etc -->	

</div>   <!--  End --- left -->	

 
 
 
 
 
 </div>  <!--  end left -->




 








<!--  START ------------------------------------------------------------------------------------------------------------------------- C l i n i c - Present --> 
<div class="right">   <!--  START --- C o n t e n t --- R i g h t -->
				
 		<div class = "toptitle_bar">  </div> 
		<div class = "toptitle_doctor_pre">  </div>

		<div class="side_clinic_pre"> 		<!--  START --- C l i n i c - Present -->
			<div class="sidebar_clinic_pre">
				<ul>
					<img src="./images/shared/review/doctor.jpg"  alt="" title="" border="" class="siderightpost_doctor_1" />
					<li> <h3> ศัลยแพทย์ ชาตรี พรห﻿มโชติ </h3> </li>
					<li> <img src="./images/shared/review/clinic.png"> คลินิก เชียงใหม่ ศัลยกรรม   </li>
				</ul>
			</div>
							
		</div>  <!--  END --- C l i n i c - Present -->
 
</div>  <!--  end right -->
<!--  END ------------------------------------------------------------------------------------------------------------------------- C l i n i c - Present --> 



 
  	<div class = "right">	<!--  START right side_doctor -->
		<div class = "toptitle_bar">  </div> 
		<div class = "toptitle_doctor">  </div>

		<div class="side_doctor"> 		<!--  START --- D O C T O R -->
			<div class="sidebar_doctor_review">
				<ul>
					<img src="./images/shared/review/doctor.jpg"  alt="" title="" border="" class="siderightpost_doctor" />
					<li> <h3> ศัลยแพทย์ ชาตรี พรห﻿มโชติ </h3> </li>
					<li> vote 1  <img src="./images/shared/review/comment.png"> 0 reviews </li>
					<li> <img src="./images/shared/review/clinic.png"> คลินิก เชียงใหม่ ศัลยกรรม   </li>
				</ul>
			</div>
  				
			<div class="sidebar_doctor_review">
				<ul>
					<img src="./myfile/contactus_00.jpg" alt="" title="" border="" class="siderightpost_doctor" />
					<li> <h3> ศัลยแพทย์ วิมล ศิริมหาราช </h3> </li>
					<li> vote 0 <img src="./images/shared/review/comment.png"> 13 reviews </li>
					<li> <img src="./images/shared/review/clinic.png"> คลินิกหมอวิมล   </li>
				</ul>
			</div>
			
 
			<a> See more... </a>
		  
		</div>  <!--  END --- D O C T O R -->
 
	</div>	<!--  end right side_doctor -->

</div>  <!--  end right -->

 
 
 
  

 <!-- start footer -->         
<div id="footer">
<!-- <div id="footer-pad">&nbsp;</div> -->
	<!--  start footer-left -->
	<div id="footer-left"> Contact : beautyclinic@info	
	  <a href="">BeautyClinic &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>.</div>
	<!--  end footer-left -->
 </div>
<!-- end footer -->

 

</div>
<!--  end content -->


</div>
<!--  end container -->

  


 
 </div>
<!-- END   ........................................................................................................................ END MAIN -->


</body>
</html>